package com.ts.api.module.api.entity.vo;

import com.gitee.apanlh.util.base.CollUtils;
import com.ts.api.module.api.entity.ApiProtocol;
import com.ts.api.module.match.plan.internal.distribute.model.PlanDistributePhoneMaskField;
import lombok.Data;

import java.util.List;

/**
 *  返回撞库结果-手机号掩码实体
 *
 *  @author Pan
 */
@Data
public class RespV3ApiDataExchangePhoneMaskVO {

    /** 本次请求id */
    private String reqId;
    /** 手机掩码字段 */
    private List<PlanDistributePhoneMaskField> listPlanDistributePhoneMaskField;

    public RespV3ApiDataExchangePhoneMaskVO() {
        super();
    }

    /**
     *  构造对象
     *  <br>自定义添加隐私协议对象
     *
     *  @return RespV3ApiDataExchangeVO
     */
    public static RespV3ApiDataExchangePhoneMaskVO of(String reqId, List<PlanDistributePhoneMaskField> listPlanDistributePhoneMaskField) {
        RespV3ApiDataExchangePhoneMaskVO respV3ApiDataExchangeVO = new RespV3ApiDataExchangePhoneMaskVO();
        respV3ApiDataExchangeVO.setReqId(reqId);

        //  添加隐私协议对象
        for (PlanDistributePhoneMaskField planDistributePhoneMaskField: listPlanDistributePhoneMaskField) {
            List<ApiProtocol> newProtocolList = CollUtils.newArrayList();
            ApiProtocol apiProtocol = ApiProtocol.of("《个人信息授权协议》", "https://axh.rongyiudai.com/h5ViewProtocol?uniqueCode=1fc1379861b34ef0898d7864c33b18e2");
            newProtocolList.add(apiProtocol);
            planDistributePhoneMaskField.setProtocolList(newProtocolList);
        }

        //  添加对象
        respV3ApiDataExchangeVO.setListPlanDistributePhoneMaskField(listPlanDistributePhoneMaskField);
        return respV3ApiDataExchangeVO;
    }
}
